using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RtSwitcher : MonoBehaviour
{
    [SerializeField] Button triggerButton;
    [SerializeField] CameraTextureTester cameraTextureTester;

    private bool isShowing;
    private void OnEnable()
    {
        isShowing = false;
        triggerButton.onClick.AddListener(SwitchState);
    }

    private void OnDisable()
    {
        triggerButton.onClick.RemoveAllListeners();
    }

    public void SwitchState()
    {
        cameraTextureTester.gameObject.SetActive(!isShowing);
        isShowing = !isShowing;
    }
}
